package com.example.seckill.service.model;

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

//id 名称 价格 库存 描述 销量 图片    库存分开表
@Data
public class ItemModel {
    private Integer id;
    @NotBlank(message = "商品名称不能为空")
    private String name;
    @NotNull(message = "商品价格不能为空")
    @Min(value = 0,message = "商品价格必须大于0")
    private BigDecimal price;
    @NotNull(message = "商品库存不能为空")
    @Min(value = 0,message = "商品库存必须大于0")
    private Integer stock;
    @NotBlank(message = "商品描述不能为空")
    private String desc;
    private Integer sales;

    @NotBlank(message = "商品url不能为空")
    private String url;

    private PromoModel promoModel;

    private PromoStatusEnum promoStatusEnum;

}
